import { NestFactory } from '@nestjs/core'
import { AppModule } from './app.module'
import { validateCustom } from './pipe/validate-custom'
import { NestExpressApplication } from '@nestjs/platform-express'

async function bootstrap() {
	const app = await NestFactory.create<NestExpressApplication>(AppModule)

	// 设置接口前缀，生成请求的 /api/v1/ 前缀
	app.setGlobalPrefix('api')
	// 设置静态资源访问配置
	app.useStaticAssets('uploads', { prefix: '/uploads' })
	app.useGlobalPipes(new validateCustom())
	await app.listen(3000, '0.0.0.0')
}

bootstrap()
